package com.khson.knows.portal.vo;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
//Vo  Value Object
public class RegisterVo {
    //Spring Validation 框架通过注解约束属性格式
    @NotBlank(message = "邀请码不能为空")
    private String inviteCode;
    @NotBlank(message = "电话号不能为空")
    @Pattern(regexp = "^1\\d{10}$",message = "手机号格式不正确")
    private String phone;
    @NotBlank(message = "昵称不能为空")
    @Pattern(regexp = "^.{2,20}$",message = "昵称是2到20个字符")
    private String nickname;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,20}$",message = "密码必须是6到20个字符(数字,字母,_)")
    private String password;
    @NotBlank(message = "确认密码不能为空")
    private String confirm;
}
